package utils

import (
	"fmt"
	"gitee.com/lywtimer/practice-go/utils/retriever/mock"
	"gitee.com/lywtimer/practice-go/utils/retriever/real"
)

type Retriever interface {
	Get(string) string
}

type Poster interface {
	Post(url string, form map[string]string) string
}

type Session interface {
	Poster
	Retriever
}

func Inspect(r Retriever) {
	fmt.Printf("%T %v \n", r, r)
	switch v := r.(type) {
	case *mock.Retriever:
		fmt.Println("Contents:", v.Contents)
	case *real.Retriever:
		fmt.Println("UserAgent:", v.UserAgent)
	}
}
